<template>
  <div>
    <!--视图模式-->
    <mavon-editor
      v-model='markdownContent'
      :subfield='false'
      :editable='false'
      class='my-editor'
      :ishljs='true'
      box-shadow-style='0 0 0 0 rgba(0,0,0,0)'
      default-open='preview'
      :toolbars-flag='false'
      style='z-index: 0'
    />
  </div>
</template>

<script>
import mavonEditor from 'mavon-editor'

import 'mavon-editor/dist/css/index.css'
import axios from 'axios'

export default {
  name: 'markDownPreview',
  components: {
    'mavonEditor': mavonEditor.mavonEditor
  },
  props:{
    url: {
      required: true,
      default: '',
      type: String
    }
  },
  data () {
    return {
      markdownContent:''
    }
  },
  created () {
    axios.get(this.url)
      .then(response => {
        this.markdownContent = response.data
      })
  }
}
</script>

<style scoped>

</style>